package com.example.demo.service;

import com.example.demo.entity.pojo.Card;
import com.example.demo.mapper.CardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CardService {
    @Autowired
    CardMapper cardMapper;

    /**
     * 添加卡的信息
     * @param sid
     * @param number 卡的id
     * @return
     */
    public boolean addCard(int sid,String number){
        int i = cardMapper.addCard(sid, number);
        return i > 0;
    }


    /**
     * 根据卡的id获取卡的信息
     * @param cardId
     * @return
     */
    public Card getMessage(int cardId) {
        return cardMapper.getMessage(cardId);
    }
}
